/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.bussines.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vogel
 */
@Entity
@Table(name = "login_logout")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LoginLogout.findAll", query = "SELECT l FROM LoginLogout l"),
    @NamedQuery(name = "LoginLogout.findByIdLogin", query = "SELECT l FROM LoginLogout l WHERE l.idLogin = :idLogin"),
    @NamedQuery(name = "LoginLogout.findByLogin", query = "SELECT l FROM LoginLogout l WHERE l.login = :login"),
    @NamedQuery(name = "LoginLogout.findByLogout", query = "SELECT l FROM LoginLogout l WHERE l.logout = :logout")})
public class LoginLogout implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Login")
    private Integer idLogin;
    @Column(name = "Login")
    @Temporal(TemporalType.TIMESTAMP)
    private Date login;
    @Column(name = "Logout")
    @Temporal(TemporalType.TIMESTAMP)
    private Date logout;
    @JoinColumn(name = "Rut_Empleado", referencedColumnName = "Rut_Empleado")
    @ManyToOne(optional = false)
    private Empleados rutEmpleado;

    public LoginLogout() {
    }

    public LoginLogout(Integer idLogin) {
        this.idLogin = idLogin;
    }

    public Integer getIdLogin() {
        return idLogin;
    }

    public void setIdLogin(Integer idLogin) {
        this.idLogin = idLogin;
    }

    public Date getLogin() {
        return login;
    }

    public void setLogin(Date login) {
        this.login = login;
    }

    public Date getLogout() {
        return logout;
    }

    public void setLogout(Date logout) {
        this.logout = logout;
    }

    public Empleados getRutEmpleado() {
        return rutEmpleado;
    }

    public void setRutEmpleado(Empleados rutEmpleado) {
        this.rutEmpleado = rutEmpleado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLogin != null ? idLogin.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LoginLogout)) {
            return false;
        }
        LoginLogout other = (LoginLogout) object;
        if ((this.idLogin == null && other.idLogin != null) || (this.idLogin != null && !this.idLogin.equals(other.idLogin))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.bussines.entities.LoginLogout[ idLogin=" + idLogin + " ]";
    }
    
}
